package com.fw.system.admin.service.impl;

import java.util.List;
import com.fw.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.fw.common.IdXD;
import com.fw.system.admin.mapper.TbSignUserMapper;
import com.fw.system.admin.domain.TbSignUser;
import com.fw.system.admin.service.ITbSignUserService;
import com.fw.utils.DateUtils;
/**
 * 签到Service业务层处理
 * 
 * @author yanwei
 * @date 2023-04-04
 */
@Service
public class TbSignUserServiceImpl extends ServiceImpl<TbSignUserMapper, TbSignUser> implements ITbSignUserService
{
    @Autowired
    private TbSignUserMapper tbSignUserMapper;

    @Autowired
    private IdXD idXD;

    /**
     * 查询签到
     * 
     * @param id 签到ID
     * @return 签到
     */
    @Override
    public TbSignUser selectTbSignUserById(String id)
    {
        return tbSignUserMapper.selectTbSignUserById(id);
    }

    /**
     * 查询签到列表
     * 
     * @param tbSignUser 签到
     * @return 签到
     */
    @Override
    public List<TbSignUser> selectTbSignUserList(TbSignUser tbSignUser)
    {
        return tbSignUserMapper.selectTbSignUserList(tbSignUser);
    }

    /**
     * 新增签到
     * 
     * @param tbSignUser 签到
     * @return 结果
     */
    @Override
    public int insertTbSignUser(TbSignUser tbSignUser)
    {
        tbSignUser.setCreateTime(DateUtils.getNowDate());
        tbSignUser.setId(idXD.nextId());
        return tbSignUserMapper.insertTbSignUser(tbSignUser);
    }

    /**
     * 修改签到
     * 
     * @param tbSignUser 签到
     * @return 结果
     */
    @Override
    public int updateTbSignUser(TbSignUser tbSignUser)
    {
        return tbSignUserMapper.updateTbSignUser(tbSignUser);
    }

    /**
     * 批量删除签到
     * 
     * @param ids 需要删除的签到ID
     * @return 结果
     */
    @Override
    public int deleteTbSignUserByIds(String[] ids)
    {
        return tbSignUserMapper.deleteTbSignUserByIds(ids);
    }

    /**
     * 删除签到信息
     * 
     * @param id 签到ID
     * @return 结果
     */
    @Override
    public int deleteTbSignUserById(String id)
    {
        return tbSignUserMapper.deleteTbSignUserById(id);
    }
}
